﻿using WH.Model.Enums;
using System.ComponentModel.DataAnnotations;

namespace WH.Contracts.Systems.Users
{
    /// <summary>
    /// 用户
    /// </summary>
    public class UserInputDto
    {

        /// <summary>
        /// 编号（工号）
        /// </summary>
        [Required(ErrorMessage = "编号不能为空")]
        [MaxLength(50, ErrorMessage = "编号最大长度为50")]
        public string Code { get; set; } = null!;

        /// <summary>
        /// 账号
        /// </summary>
        [Required(ErrorMessage = "账号不能为空")]
        [MaxLength(50, ErrorMessage = "账号最大长度为50")]
        public string Account { get; set; } = null!;

        /// <summary>
        /// 密码
        /// </summary>
        //[Required(ErrorMessage = "密码不能为空")]
        [MaxLength(50, ErrorMessage = "密码最大长度为50")]
        public string? Password { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [Required(ErrorMessage = "名称不能为空")]
        [MaxLength(50, ErrorMessage = "名称最大长度为50")]
        public string Name { get; set; } = null!;

        /// <summary>
        /// 机构ID
        /// </summary>
        [Required(ErrorMessage = "机构ID不能为空")]
        [MaxLength(50, ErrorMessage = "机构ID最大长度为50")]
        public string OrganizationId { get; set; } = null!;

        /// <summary>
        /// 状态（0停用 1正常）
        /// </summary>
        public bool IsEnable { get; set; }

        /// <summary>
        /// 性别（0女 1男 2未知）
        /// </summary>
        //[Required(ErrorMessage = "性别不能为空")]
        [MaxLength(50, ErrorMessage = "性别最大长度为50")]
        public string? Sex { get; set; }

        /// <summary>
        /// 排序码 数字越小越靠前
        /// </summary>
        public int SortCode { get; set; }

        /// <summary>
        /// 描述/备注说明
        /// </summary>
        [MaxLength(255, ErrorMessage = "备注最大长度为255")]
        public string? Remark { get; set; }

        /// <summary>
        /// 科室 读取sys_organize表中的fid
        /// </summary>
        //[Required(ErrorMessage = "科室ID不能为空")]
        [MaxLength(50, ErrorMessage = "科室ID最大长度为50")]
        public string? DepartmentId { get; set; }

        /// <summary>
        /// 角色主键  读取sys_role表中category=1的fid
        /// </summary>
        [Required(ErrorMessage = "角色ID不能为空")]
        [MaxLength(50, ErrorMessage = "角色ID最大长度为50")]
        public string RoleId { get; set; } = null!;

        /// <summary>
        /// 手机号码
        /// </summary>
        [MaxLength(50, ErrorMessage = "手机号码最大长度为50")]
        public string? PhoneNumber { get; set; } = null!;

        /// <summary>
        /// 邮箱
        /// </summary>
        [MaxLength(50, ErrorMessage = "邮箱最大长度为50")]
        public string? Email { get; set; }

        /// <summary>
        /// id
        /// </summary>
        [MaxLength(50, ErrorMessage = "ID最大长度为50")]
        public string? Id { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [MaxLength(500, ErrorMessage = "头像最大长度为500")]
        public string? AvatarUrl { get; set; }


        /// <summary>
        /// 证件类型
        /// </summary>
        [MaxLength(50, ErrorMessage = "证件类型最大长度为50")]
        public string? CardTypeCode { get; set; }

        /// <summary>
        /// 证件号码
        /// </summary>
        [MaxLength(50, ErrorMessage = "证件号码最大长度为50")]
        public string? CardTypeNo { get; set; }


        /// <summary>
        /// 微信号
        /// </summary>
        [MaxLength(50, ErrorMessage = "微信号码最大长度为50")]
        public string? WeiXin { get; set; }


        /// <summary>
        /// 用户类型
        /// </summary>
        [MaxLength(50, ErrorMessage = "用户类型最大长度为50")]
        public string? UserTypeCode { get; set; }

        /// <summary>
        /// 访问类型 1：系统用户   2：对接用户
        /// </summary>
        //[Required(ErrorMessage = "用户访问类型不能为空")]
        public UserAccessTypeEnum? AccessType { get; set; } = UserAccessTypeEnum.System;

        /// <summary>
        /// 生日
        /// </summary>
        public DateTime? Birthday { get; set; }
    }
}
